<?php

class registry
{

	private $store = array();
	static private $thisInstance = null;

	public function __construct() { }
	
	public function __set($label, $object) {
			
		if(!isset($this->store[$label]))
		{
			$this->store[$label] = $object;
		}
		
	}

	public function __unset($label) {
			
		if(isset($this->store[$label]))
		{
			unset($this->store[$label]);
		}
		
	}
	
	public function __get($label) {
			
		if(isset($this->store[$label]))
		{
			return $this->store[$label];
		}
		
		return false;
		
	}
	
	public function __isset($label) {
			
		if(isset($this->store[$label]))
		{
			return true;
		}
		
		return false;
		
	}
	static public function getInstance() {
		
		if(self::$thisInstance == null)
		{
			self::$thisInstance = new registry();
		}
		
		return self::$thisInstance;
	}

}

?>